//
//  ATRootTabBarController.m
//  Adorable_Things
//
//  Created by huzhiyan on 16/1/11.
//  Copyright © 2016年 Banana Inc. All rights reserved.
//

#import "ATRootTabBarController.h"
#import "BQHomePageViewController.h"
#import "TTDiscoverMainViewController.h"
#import "ZYCategoryViewController.h"
#import "DJShopMainViewController.h"

@interface ATRootTabBarController ()<UITabBarControllerDelegate>

@end

@implementation ATRootTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    
    BQHomePageViewController *BQVC = [[BQHomePageViewController alloc]init];
    UINavigationController *BQNav = [[UINavigationController alloc]initWithRootViewController:BQVC];
    BQVC.tabBarItem.image = [UIImage imageNamed:@"iconfont-shouye (2)"] ;
    BQNav.tabBarItem.title = @"主页";
    
    ZYCategoryViewController *ZYVC = [[ZYCategoryViewController alloc]init];
    UINavigationController *ZYNav = [[UINavigationController alloc]initWithRootViewController:ZYVC];
    ZYVC.tabBarItem.image = [UIImage imageNamed:@"iconfont-XAutomatic-configuration"];
 //   ZYVC.tabBarItem.selectedImage = [UIImage imageNamed:@"iconfont-XAutomatic-configuration(1)"];
    ZYNav.tabBarItem.title = @"分类";
    
    DJShopMainViewController *DJVC = [[DJShopMainViewController alloc]init];
    UINavigationController *DJNav = [[UINavigationController alloc]initWithRootViewController:DJVC];
    DJVC.tabBarItem.image = [UIImage imageNamed:@"iconfont-shangdian01"];
    DJNav.tabBarItem.title = @"萌店";
    
    TTDiscoverMainViewController *TTVC = [[TTDiscoverMainViewController alloc]init];
    UINavigationController *TTNav = [[UINavigationController alloc] initWithRootViewController:TTVC];
    TTVC.tabBarItem.image = [UIImage imageNamed:@"iconfont-iconfaxian"];
    TTNav.tabBarItem.title = @"萌物志";

    self.tabBar.tintColor = [UIColor redColor];
    self.viewControllers = @[BQNav,ZYNav,DJNav,TTNav];
    self.selectedIndex = 0;
  //  self.delegate = self;
    
}

// 选中页面时触发的方法
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
    // 选中时把红点去除
    viewController.tabBarItem.badgeValue = nil;
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
